<template>
	<view>
		<u-tabbar v-model="current" :list="list" active-color="#0591FE" inactive-color="#999" @click="changeIndex"></u-tabbar>
	</view>
</template>

<script>
	export default {
		name: "tarbar",
		data() {
			return {
				list: [{
						iconPath: "/static/tarbar/crm.png",
						selectedIconPath: "/static/tarbar/crm_select.png",
						text: 'crm',
						customIcon: false,
						pagePath: "/pages/index/index"
					},
					{
						iconPath: "/static/tarbar/yingyong.png",
						selectedIconPath: "/static/tarbar/yingyong_select.png",
						text: '应用',
						customIcon: false,
						pagePath: "/pages/application/application"
					},
					{
						iconPath: "/static/tarbar/my.png",
						selectedIconPath: "/static/tarbar/my_select.png",
						text: '我的',
						customIcon: false,
						pagePath: "/pages/my/my"
					},
					{
						pagePath: "/pages/user_index/user_index",
						iconPath: "/static/tarbar/kectwo.png",
						selectedIconPath: "/static/tarbar/kecone.png",
						text: "课程",
						customIcon: false,
					},
					{
						pagePath: "/pages/user_mine/user_mine",
						iconPath: "/static/tarbar/my.png",
						selectedIconPath: "/static/tarbar/my_select.png",
						text: "我的",
						customIcon: false,
					}
				],
				current: 0
			};
		},
		methods:{
			changeIndex(e){
				console.log(e);
				if(this.current == e) return;
				this.current == e
				let url = this.list[e].pagePath
				uni.switchTab({
					url: url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
// /deep/ .u-tabbar__content .tabbar__content__item__text{
// 	font-size: 24rpx;
// 	font-family: Source Han Sans SC;
// 	font-weight: 400;
// }
</style>
